'''
Created on 2012-9-19

@author: infear
'''
it=iter([1,2,3])
print it.next()

def iterator(_list):
    for i in _list:
        yield i

def iterator_recrusive(_list):
    try:
        try:
            _list+""
        except:
            pass
        else:
            raise TypeError                         
        for i in _list:
            for j in iterator_recrusive(i):
                yield j
    except TypeError:
        yield _list

       
        
for num in iterator([1,2,3]):
    print num

for num in iterator_recrusive([[1,2],[[2,3],[4,5],["as"]]]):
    print num